package com.vip.service.order.impl;

import com.vip.dao.admin.domain.User;
import com.vip.dao.order.dao.ShopOrderDao;
import com.vip.dao.order.domain.ShopOrder;
import com.vip.service.order.ShopOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShopOrderServiceImpl implements ShopOrderService {

    @Autowired
    ShopOrderDao shopOrderDao;


    @Override
    public List<ShopOrder> findShopOrderByUid(Long uid) {
        return shopOrderDao.findShopOrderByUid(uid);
    }

    @Override
    public List<ShopOrder> findAllShopOrder() {
        return shopOrderDao.findAll();
    }

    @Override
    public void deleteOrder(Long id) {
        shopOrderDao.deleteById(id);
    }

    @Override
    public ShopOrder addOrder(ShopOrder order) {
        return shopOrderDao.save(order);
    }

    @Override
    public ShopOrder findOrderById(Long id) {
        return shopOrderDao.findById(id).get();
    }
}
